package cn.iocoder.yudao.module.crm.controller.admin.statistics;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.tag.CrmStatisticsTagReqVO;
import cn.iocoder.yudao.module.crm.controller.admin.statistics.vo.tag.CrmStatisticsTagRespVO;
import cn.iocoder.yudao.module.crm.service.statistics.CrmStatisticsTagService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;


@Tag(name = "管理后台 - CRM 统计-标签统计")
@RestController
@RequestMapping("/crm/statistics-tag")
@Validated
public class CrmStatisticsTagController {


    @Resource
    private CrmStatisticsTagService statisticsTagService;


    @GetMapping("/customer-tag-count")
    @Operation(summary = "标签统计-客户标签统计")
    @OperateLog(enable = false)
    public CommonResult<List<CrmStatisticsTagRespVO>> customerCount(@Valid CrmStatisticsTagReqVO reqVO) {
        return success(statisticsTagService.getCustomerTagCount(reqVO));
    }


    @GetMapping("/clue-tag-count")
    @Operation(summary = "标签统计-线索标签统计")
    @OperateLog(enable = false)
    public CommonResult<List<CrmStatisticsTagRespVO>> clueCount(@Valid CrmStatisticsTagReqVO reqVO) {
        return success(statisticsTagService.getClueTagCount(reqVO));
    }
}
